#include <cstdio>
#include <set>
#include <cmath>
#include <cstring>
#define eps 1e-8
using namespace std;

struct Node
{
    double h;
    int id;
    Node( ) { }
    Node( double _h, int _id )
        : h( _h ), id( _id ) { }
};

bool operator < ( const Node &a, const Node &b )
{
    if ( fabs( a.h - b.h ) < eps ) return a.id > b.id;
    return a.h < b.h;
}

double H[ 10001 ], h[ 10001 ], theta;
const double pi = acos( -1.0 );
int n, w[ 10001 ], w2[ 10001 ];
set<Node> s;

void init( )
{
    int i;
    double t;
    set<Node>::iterator p, k;
    for ( i = 0; i < n; i++ )
        scanf("%lf", &H[ i ]);
    if ( theta > 0 )
        for ( i = 0; i < n / 2; i++ )
        {
            t = H[ i ];
            H[ i ] = H[ n - i - 1 ];
            H[ n - i - 1 ] = t;
        }
    else
        theta = -theta;
    theta *= pi / 180;
    memset( w, -1, sizeof( w ) );
    memset( w2, -1, sizeof( w2 ) );
    s.clear( );
    for ( i = 0; i < n; i++ )
    {
        h[ i ] = ( n - i - 1 ) * sin( theta ) + H[ i ] * cos( theta );
        s.insert( Node( h[ i ], i ) );
        p = s.find( Node( h[ i ], i ) );
        for ( ; p != s.begin( ); )
        {
            k = p;
            k--;
            w[ k->id ] = i;
            s.erase( k );
        }
    }
    s.clear( );
    for ( i = n - 1; i >= 0; i-- )
    {
        s.insert( Node( h[ i ], i ) );
        p = s.find( Node( h[ i ], i ) );
        if ( p == s.begin( ) ) continue;
        k = p;
        k--;
        w2[ i ] = k->id;
        for ( ; p != s.begin( ); )
        {
            k = p;
            k--;
            s.erase( k );
        }
    }/*
    for ( i = 0; i < n; i++ )
        printf("%lf ", h[ i ]);
    puts("");
    for ( i = 0; i < n; i++ )
        printf("%d ", w[ i ]);
    puts("");
    for ( i = 0; i < n; i++ )
        printf("%d ", w2[ i ]);
    puts("");*/
}

void work( )
{
    int i, j, k, t;
    double ans = 0, area, d, st = sin( theta ), tt = tan( theta );
    int p;
    for ( i = 0; i < n; i++ )
    {
        t = i;
        p = w[ i ];
        area = 0;
        //printf("%lf\n", ans);
        if ( p == -1 )
        {
            p = w2[ i ];
            if ( p == -1 ) continue;
            for ( k = p - 1; k >= i; k-- )
                if ( h[ k ] > h[ p ] )
                    break;
        //    printf("%d %d\n", p, k);
            if ( h[ p ] >= h[ k ] - st )
            {
                for ( j = k + 1; j < p; j++ )
                    if ( H[ k ] > H[ j ] )
                        area += H[ k ] - H[ j ];
                    else
                        area -= H[ j ] - H[ k ];
                d = p - k - ( h[ k ] - h[ p ] ) / st;
                area += d * d * tt / 2;
                ans += area;
                i = p - 1;
            }
            else
            {
                for ( j = k + 1; j < p; j++ )
                    area += H[ p ] - H[ j ];
                area -= ( p - k - 1 ) * ( p - k - 1 ) * tt / 2;
                ans += area;
                i = p - 1;
            }
            continue;
        }
        for ( j = i + 1; j < p; j++ )
        {
            if ( H[ i ] > H[ j ] )
                area += H[ i ] - H[ j ];
            else
                area -= H[ j ] - H[ i ];
        }
        area += ( p - i ) * ( p - i ) * tt / 2;
        ans += area;
        i = p - 1;
    }
    printf("%.2lf\n", ans);
    //printf("%lf\n", 1 * 1 * tan( theta ) / 2 + 1 + 2 * 2 * tan( theta ) / 2);
}

int main( )
{
    while ( scanf("%d%lf", &n, &theta) != EOF )
    {
        init( );
        work( );
    }
    return 0;
}
